<html>
<head>
	<meta charset="UTF-8">
	<METAHTTP-EQUIV="Pragma"CONTENT="no-cache">
	<METAHTTP-EQUIV="Cache-Control"CONTENT="no-cache">
	<METAHTTP-EQUIV="Expires"CONTENT="0">
	<link rel="stylesheet" href="css/bootstrap.css"> 
	<script src="js/jquery.js"></script>
	<script src="js/angular.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
</head>
<body ng-app="myApp" ng-controller="siteCtrl">
	<img alt="用户" src="image/timg.jpg" width="15px" height="15px">&nbsp;{{aaa}}
	<a href="javascript:void(0)" ng-click="logout()">退出系统</a>
	<script type="text/javascript">
	var app = angular.module('myApp', []);
    
	app.controller('siteCtrl', function($scope, $http) {
		$http.get('/getUser').then(function successCallback(response) {
  			console.log(response)
  			$scope.aaa=response.data.user;
        }, function errorCallback(response) {
            // 请求失败执行代码
            console.log(response)
    	});
		
		$scope.logout=function(){
			$http.get('/logout').then(function successCallback(response) {
				window.parent.location.href="login.html";
	        }, function errorCallback(response) {
	            // 请求失败执行代码
	            console.log(response)
	    	});
		}
	});
	</script>
</body>
</html>